package io.springboot.jpa.examples.springbootjpaexamples.service;

import io.springboot.jpa.examples.springbootjpaexamples.model.Person;
import io.springboot.jpa.examples.springbootjpaexamples.repository.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @author yzc
 * @description
 * @date 2018/9/2
 */
@Service
public class PersonService {

    @Autowired
    private PersonRepository personRepository;

    public Page<Person> findAll(Pageable pageable) {
        return personRepository.findAll(pageable);
    }

    public Person getOne(long id) {
        return personRepository.getOne(id);
    }
}
